package com.qding.park.adapter.report.valid;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import org.apache.commons.lang3.StringUtils;

public class OutOpSpecialValid implements ConstraintValidator<OutOpSpecial, String>{
    
    @SuppressWarnings("unused")
    private OutOpSpecial constraintAnnotation;

    @Override
    public void initialize(OutOpSpecial constraintAnnotation) {
        this.constraintAnnotation=constraintAnnotation;
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        
        if(null==value){
            return true;
        }
        
        if("freeCar".equals(value)){
            return true;
        }else if("fireEngine".equals(value)){
            return true;
        }
        return false;
    }

}
